home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: softbase@mercury.interpath.com (Scott McMahan - Softbase Systems)
- Newsgroups: comp.lang.c.moderated,comp.lang.c,comp.std.c
- Subject: Re: Perhaps it's time the C community *did* something about bad books.
- Followup-To: comp.lang.c.moderated,comp.lang.c,comp.std.c
- Date: 25 Jan 1996 20:41:12 -0600
- Organization: Interpath -- Providing Internet access to North Carolina
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4e9f08$9br@solutions.solon.com>
- References: <4e07lv$adu@solutions.solon.com> <4e5ooa$6b5@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Ray Dunn (ray@ultimate-tech.com) wrote:
- : In referenced article, Peter Seebach says...
- : >I call your attention to Schildt's "C: The Complete Reference".
- : There is a long crit of this book, with many errors listed, at:
- : http://bit.csc.lsu.edu/tutorial/ten-commandments/schildt.html
-
- Not exactly. This is actually the review of the ANSI C standard.
- The "review" errs on the side of being way too critical, and I've
- seen it being debunked in part, but the parts that are debunked
- never seem to be posted with the review anywhere. It's one of those
- things that will endure forever.
-
- I did not see the post that listed errors in C: TCR. I'm interested
- in reading it.
-
- I agree that we should all make Osborne aware of all the errors in
- Mr. Schildt's book so that he can make them better in future
- editions. I was very disappointed in the 3rd Ed. compared to
- the 2nd.
-
- Scott
-
- PS: Here is the review of the 3rd Ed I wrote when I got it last
- summer.
-
- C: The Complete Reference, Third Edition
- By Herbert Schildt, published by Osborne/McGraw-Hill
- ISBN 0-07-882101-0
-
- A review by Scott McMahan, July-August 1995
-
- ---------------------------------------------------------------------------
-
- I finally got my copy of C: The Complete Reference -- not a review copy,
- as I've never been able to make contact with any Osborne press people.
- I don't know if they even send out review copies, but if they do I've
- never been able to get my foot in the door. I thought I'd give the book
- a once over anyway. It took me some time to complete this review, for
- various reasons, so it isn't as timely as I thought. On the other hand,
- the third edition seems to have been released in extreme secrecy since I
- learned about it only though a McGraw-Hill book-of-the-month club ad.
-
- Way back when, I learned C using Schildt's Teach Yourself C, and have
- always had a soft spot for his writing. He is a capable author who has
- the ability to simplify complex topics enough for people who have not
- had exposure to them before. I'm certainly not suggesting his books can
- replace Sedgewick's Algorithms In C or K&R2 (both of which I consult
- regularly), but they give a kinder, gentler approach to topics that
- prepares you for the more precise and "heavy" books you'll have to read
- later on. If anyone is willing to give Herbert Schildt a fair shake, it
- would be me, since I have benefitted from his writing in the past and
- have read a significant number of his books. I've even defended some of
- the wilder acusations about Schildt on the net, but after the third
- edition I don't think I'll bother. I intend to send a copy of this
- review to him in care of his consulting office in order to hopefully
- make the fourth edition much better than the third.
-
- Just picking up the book, one obvious thing is the print is smaller.
- Holding it up to an earlier book like Turbo C/C++: The Complete
- Reference 1st edition makes the difference startling. Paper costs have
- gone up tremendously in the past few years, and shrinking the type books
- and other things are set in is very common. It's unfortunate for the
- eyes.
-
- The page layout has been revamped, with little improvement. Big grey
- bands set off code from the text, which is unnecessary and makes the
- chapters on functions (each of which comes with an example program) very
- chaotic looking. The bands overpower the headers, which is what you're
- skimming for. Compare the stylized 'C' with the logo of my C And C++
- Review -- wavy pixilated designs with the foreground blurred into the
- background. I'm sure this is nothing but a coincidence.
-
- What's up in the third edition?
-
- Unfortunately, Schildt has chosen not to correct the void main(void)
- anachronism. From what I understand, the usage which is clearly and
- flagrantly contrary to the ANSI standard is a throwback to pre-ANSI DOS
- C compilers' rather strange ideas on returning values to the calling
- environment. (I don't know why this is even a problem, as returning a
- value in register AX is incredibly commonplace to any DOS program. Most
- assembly language utilities you run across return a value to DOS use
- register AX for their processing to kill two birds in one stone: #1 not
- having to clean up the register, and #2 returning the value as a
- side-effect of the computation.)
-
- To make this issue even more bizarre, Schild says on page 163: "The
- main() function returns an integer to the calling process, which is
- generally the operating system." The part is absolutely true (the part
- about the operating system isn't -- usually programs are started by some
- type of command interpreter doing an exec() or spawn() call, and the
- command interpreter gives some meaning to the return value). Then, from
- this very stable ground of ANSI behavior, Schildt takes a flying leap
- off a cliff and says in the next paragraph: "You may also declare main()
- as void if it does not return a value". Since he has just said in the
- preceeding paragraph: "If main() does not return a value, the value
- passed to the calling process is technically undefined. In practice,
- most C compilers automatically return 0, but do not rely on this
- behavior if portability is a concern." -- it makes me wonder why he
- doesn't just explicitly return a value, instead of hoping for the best
- from undefined behavior? (And remember what undefined means: The C
- compiler can do ANYTHING it wants, including what the GNU compiler did
- to protest the inclusion of #pragma in the standard, start a game of
- rogue.) A void-declared main is undefined. An integer-declared main is
- defined, and just returns garbage. Garbage is better than undefined
- behavior.
-
- The silliest thing is "main()" is a lot easier to write than "void
- main(void)", which is equivalent to using stilted, awkward phraseology
- in English. As a writer, Schildt should at least have his inner ear
- tuned to the easiest, best-flowing way to phrase things. Additional
- silliness comes from the fact that some of the material is 5-10 years
- old, and some of it is brand new. Thus some parts of the book use void
- main(void) and some don't. The little C interpreter, for example, does
- not parse this syntax. (It was, in fact, written before ANSI C, and its
- syntax doesn't include the ANSI keywords -- as much as Schildt likes his
- void affectation, this is surprising. Adding the "void" keyword to an
- interpreter would be little more difficult than ignoring the word
- "void".) Another example is that all the Windows' functions are declared
- as "int WINAPI WinMain", which makes little sense as the return value of
- a WinMain is as clearly defined as the return value of an ANSI C
- function. If one definition of program behavior is to be ignored, why
- aren't all? This is inconsistent. It should be void WINAPI WinMain.
- This is as undefined as the ANSI C definition of main()'s declaration.
-
- The book is still very much PC based. It isn't a true ANSI C reference
- like the book would like to mislead you with the front and back cover
- copy. This is unfortunate, because the truth-in-advertising issue gives
- Schildt a lot of bad press. If they just said "for PC programmers" on
- the cover, they'd eliminate a lot of the vitriol the book receives. A
- lot of stuff is outright PC based (as described below) and would work on
- nothing but a PC. A lot of the other stuff is based on the assumption
- that you're on a PC (such as the size of a word is a 16 bit half-word).
- It would work, but differently, in other environments. This is the
- dangerous stuff. Instead of calling it a Complete Reference, it would be
- a lot more precise to say that the book is a superset of ANSI C for PC
- programmers. (I think "complete" is a joke anyway, like the "complete"
- Internet reference. How can anything written about the Internet be
- complete...!?!)
-
- In addition, Schildt discusses only the Microsoft and Borland compilers!
- No mention of Mix, GNU, Watcom, or any others. This isn't a complete PC
- reference, either. If you're going to talk about PC compilers, and be
- complete, you need to cover compilers as popular as Mix's Power C. I
- understand a book like Turbo C/C++: The Complete Reference covering one
- specific compiler, but when the door is opened to all PC C compilers,
- coverage of the major players is necessary.
-
- Topics of interest to PC programmers include:
-
- The segmented 80x86 memory model, which is a non-issue now that
- Windows 95 allows you to write flat memory model programs (the
- same Windows 95 about which a chapter is included in this very
- book, see below);
-
- Microsoft C/C++ console graphics functions (which are for some
- inexplicable reason claimed to have been deleted, in the
- introduction, but are still present in the text! Chapter 17 is
- nothing but the Microsoft C/C++ 7 DOS-mode graphics chapter in
- the MS manual, warmed over);
-
- DOS assembly language, both compiler output (for efficiency
- purposes, ironically he's using an old CISC chip for his
- efficiency material) and for interfacing C and asm.
-
- That's an interesting cross-section of DOS. Lots of bizarre looking
- functions like "_intdos" and "_intdosx" appear, which some compilers
- allow you to use. (Come on, if you're going to call DOS interrupts, why
- not use embedded assembly language? If you're going to be non-standard,
- using the nonstandard asm keyword is a lot more explicit! The asm
- keyword is more widespread, at least, and the assembly language screams
- "I'm a non-standard module".)
-
- On p. 8, Schildt claims spreadsheets are systems programs. I never
- really considered that to be true, but then again OS/2 Warp does, in
- fact, ship with a spreadsheet as part of the basic OS package. I guess
- times change. Once, spreadsheets were applications that you had to (and
- still have to if you want to do anything serious) buy on your own. As
- you can guess, this is probably a result of the years of cutting and
- pasting done to the book.
-
- What's new? The third edition is surprisingly unchanged. Instead of
- taking the chance to reflect on which chapters he has written in his
- almost 10 years of writing on C and picking the ones that would be most
- useful to an ANSI C programmer, Schildt has instead placed chapters that
- have little to do with a complete reference, including a tacky
- self-promotion.
-
- A C interpreter: this is from the out of print book Born To Code In C,
- although I am under the impression that the material in Born was also
- reused in The Art Of C and The Craft Of C.
-
- It is hillarious to contrast the wording between Born To Code In C,
- where the C interpreter is in the first chapter, to the third edition,
- where it is in the last chapter. Either one by itself reads fine, but
- when you contrast them side-by-side, the results of the cut & paste job
- are side-splitting as Schildt's enthusiasm and sincerity are shattered
- when you see how he changed a couple of lines.
-
- The good thing, though, is that the interpreter source code is readily
- available. It's not a bad program, although I haven't typed it all in.
- It looks like it does a decent job. A lot of people want to have a C
- interpreter. With Born To Code In C out of print, this makes it availble
- to everyone.
-
- (This is another big beef I have with the book: the blasted thing is
- $35, you think that they could have put a disk with the source code in
- with the book! I've seen books a lot cheaper than this with disks.)
-
- It's nice to have the interpreter and the recursive descent parser in
- the same book. (Schildt's continued insistence -- probably more because
- he didn't read the chapter on the parser when he cut & paste it than
- anything intentional -- that recursive descent parsing is somehow
- mysterious or secret is not really in keeping with the times. Most
- college CS courses on recursion cover them. The only people to whom
- recursive descent parsing would be mysterious are users who are not
- sophisticated enough to understand algorithms in general.) Having them
- separated makes referencing one while reading the other a pain,
- especially when one book is at home and the other at work.
-
- (Perhaps a coincidence, perhaps not: the section on ideas to extend the
- interpreter has as one suggestion adding an integrated editor: exactly
- what Quincy, the interpreter Dr. Dobbs' Al Stevens wrote.)
-
- I almost took the book back and demanded a refund when I saw this. A
- chapter on Windows 95 is nothing but a shameless, tacky ad for Schildt's
- new Windows 95 Programming book. They should have put this chapter at
- the back of the book and clearly labeled it as an ad. Windows 95
- programming has no place in a generic ANSI C book. Schildt just took a
- chapter out of his Windows 95 book and pasted it in here. It is not ANSI
- C, it is not even particularly C, it has nothing at all to do with a
- "complete" reference since the skeleton doesn't do anything, and
- all-around is just plain bad. The bad feelings generated by this
- sickening ad will more than destroy any small sales increase M-H gets.
-
- What isn't new is the sad part -- with the disgusting ad and the C
- interpreter (which although useful is certainly not anything you'd
- expect in a C reference), Schildt did not include the chapters from
- Advanced C on statistics and random number generation. For an ANSI C
- programmer, this material would have been much more useful. People are
- asking for random number generators all the time on comp.lang.c, and the
- older Advanced C book has several. Advanced C, which is now out of
- print, has a lot of information that would be useful to the general ANSI
- C programmer. I asked Schildt to consider including these chapters, to
- which he responded with a positive message that he'd consider it, and
- yet greed and advertising won out over the usefulness the book would
- have had to people. I see requests for random number generators on
- comp.lang.c frequently. It is material people have an interest in and
- need to know regardless of what C implementation is used.
-
- There's also not much on hashing, one of the fundamental things you need
- to do in C. I had to write a hash very recently, so I though I'd see
- what Schildt said about it. Very little, as it turned out, and only as
- an aside in a chapter on sparse arrays. The bad part is, he doesn't
- explain hashing much at all and only has an example of closed hashing.
- (My own table, for example, was open hashed. I had a situation where
- open hashing made the most sense. Who names these things, anyway? The
- type of hashing with a finite number of slots in the table is "open" and
- not "closed"?)
-
- Unless Schildt starts trying to find what people want and starts
- remembering why he wrote C: The Complete Reference in the first place,
- he and Osborne are going to have a hard time selling books with ads for
- other books instead of content and using Schildt's name. Schildt is
- already known as a schmuck among real C programmers, deservedly or not,
- and pretty soon everyone will be calling him the "recognized authority"
- on self-promotion and hot air. Either Schildt or McGraw-Hill appears to
- be damaging Schildt's already very shakey reputation beyond repair for
- small short-term gain. I don't know why, is Osborne in some kind of
- financial trouble? They should be trying to build a reputation for
- quality.
-
- Unfortunately for me, I will probably never order another edition of
- this book, unless the concerns raised here are directly addressed. I'm
- very disenchanted with this book, and will look elsewhere for my
- reference material.
-